home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0993sept.archive
/
000052_crash!unx.sas.com!jamie_Wed, 22 Sep 93 04:06:10 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
2KB
Received: by bkhouse.cts.com (V1.16/Amiga)
id AA00000; Wed, 22 Sep 93 04:06:10 PST
Received: from lamb.sas.com by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0of8CP-00006ZC; Tue, 21 Sep 93 06:56 PDT
Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/10-28-91)
id AA16196; Tue, 21 Sep 1993 09:56:07 -0400
Received: from cdevil.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90)
id AA28835; Tue, 21 Sep 1993 09:55:06 -0400
Received: by cdevil.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93)
id AA22231; Tue, 21 Sep 1993 09:55:01 -0400
Message-Id: <199309211355.AA22231@cdevil.unx.sas.com>
Date: Tue, 21 Sep 1993 09:55:01 -0500 (EDT)
X-Mailer: ELM [version 2.4 PL20]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1157
From: James Cooper <jamie@unx.sas.com>
To: amigae@bkhouse.cts.com (Amiga E Mailing List)
Subject: Re: Fixed text strings
> I'm trying to figure out how to write a fortune type of program,
> that has (for the first version anyway) 16 or so fixed sayings built
> in to the exe (no extrnal textfiles this time around). What's the
> most efficient and robust way?
> I thought that for so few items that I should use
> SELECT randomnumber
> CASE randomnumber=1
> TextF("First fortune")
> CASE randomnumber=2
> TextF("Second fortune")
> etc.
>
> or would it be more memory efficient/faster to toy around with
> pointers? And have the texts as dc.b's (or the e equivalent thereof)
Actually, here's a spot where E really shines...
You need to use an E specific feature, called 'Lists'. This will be the
best way to do what you want to do, and doesn't require any kludges.
For instance:
TextF(ListItem(['First fortune','Second fortune'],randomnumber))
Just fill in the square brackets with the fortunes you want to use, and
that single E statement does the equivalent of the SELECT statement you
started to use... :-)
(Oh, yeah... remember that E likes single quotes around strings, double
quotes around characters. Backwards from most other languages, but...)